using System;
using System.ServiceModel;
using GianosNET.Common.Classes;
using RemotedServicesCommon.Interfaces;

namespace GianosNET.Common.Interfaces
{
    [ServiceContract(
            SessionMode = SessionMode.Required,
            CallbackContract = typeof(IPubSubContract))]
    public interface IRemotedServiceManager
    {
        #region Authentication

        [OperationContract(IsOneWay = false, IsInitiating = true)]
        bool Authenticate(string userId, string password, out string token);

        [OperationContract(IsOneWay = false, IsInitiating = true)]
        void LogOff();

        #endregion

        #region Comandi sui servizi

        [OperationContract(IsOneWay = false, IsInitiating = true)]
        void StartService(Guid svcId);

        [OperationContract(IsOneWay = false, IsInitiating = true)]
        void StopService(Guid svcId);

        [OperationContract(IsOneWay = false, IsInitiating = true)]
        void StartLoopingSession(Guid svcId);

        [OperationContract(IsOneWay = false, IsInitiating = true)]
        void SetLoopingPause(Guid svcId, int secs);

        #endregion

        #region Information

        [OperationContract(IsOneWay = false, IsInitiating = true)]
        ServiceInfo[] GetServiceList();

        [OperationContract(IsOneWay = false, IsInitiating = true)]
        string GetServerVersion();

        [OperationContract(IsOneWay = false, IsInitiating = true)]
        LogQueue GetLog(Guid g);

        #endregion

        #region server requests

        [OperationContract(IsOneWay = false, IsInitiating = true)]
        void RequestServerShutdown();

        #endregion
    }
}